<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<style type="text/css">
	.wraping{
		background: #fff;
	}
	.table_btn_box{
		margin-bottom: 5px;
		float: left;
	}
		.modal-content .modal-footer button.btn-primary {
		margin-top:0; 
		margin-bottom: 0;
	}
		.btn-div{
		float: left;top: 10px;margin-bottom: 5px;padding-left: 10px;
	}
			.row{
			margin: 0;
		}
</style>
<body class="page-header-fixed">

	<div class="btn-div">
				<a class="btn blue" href="javascript:;"  data-target="#dicForwardSrvModel" 
					data-toggle="modal" ng-click="addDicForwardSrv();">
					<i class="fa fa-plus"></i>
						新增
				</a>
			</div>
			<table class="table table-striped table-bordered table-hover" id="table_1">
			<thead>
				<tr>
					<th>编号</th>
					<th>名称</th>
					<th>主ip</th>
					<th>主上报端口</th>
					<th>备用ip</th>
					<th>备用上报端口</th>
					<th>当前容量</th>
					<th>最大容量</th>
					<th>是否有效</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="dicForwardSrv in dicForwardSrvList  track by $index" on-loaded="{{$last}}" target-table="table_1">
					<td>
						<span ng-bind="dicForwardSrv.forward_srv_id"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.forward_srv_name | commonSubString"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.main_hardware_ip"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.main_port_up"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.back_headware_ip"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.back_port_up"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.current_capacity"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.capacity"></span>
					</td>
					<td>
						<span ng-bind="dicForwardSrv.valid_flag  | getValueInStaticFilter : 'validArray'"></span>
					</td>
					<td>
						<a class="btn" href="javascript:;"  data-target="#dicForwardSrvModel" 
						data-toggle="modal" ng-click="updateDicForwardSrv(dicForwardSrv);">
							修改
						</a>
						<!--<a class="btn" href="javascript:;"  data-target="#allotChargerManage" 
						data-toggle="modal" ng-click="allotChargerManage(dicForwardSrv);">
							绑定电桩管理
						</a>-->
					</td>
				</tr>
			</tbody>
			</table>
		
			<div id="dicForwardSrvModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
				<div class="modal-dialog">
					<div class="modal-content">
						<form class="w5c-form demo-form" role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="validateForm.reset()">×</button>
							<h4 class="modal-title">桩硬件服务器新增/修改</h4>
						</div>

						<div class="modal-body form">
							<div class="form-group">
								<div class="row">
									<label class="col-sm-4 control-label text-right">名称</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.forward_srv_name"  name="forward_srv_name" onkeyup="value=value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,'')" placeholder="请输入字母、数字、中文组合"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right"><span class="star-color">* </span>主ip</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.main_hardware_ip" required="" name="main_hardware_ip" ng-pattern="/^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right"><span class="star-color">* </span>主上报端口</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.main_port_up" name="main_port_up" required="" ng-pattern="/^[0-9]*$/"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right"><span class="star-color">* </span>备用ip</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.back_headware_ip" required="" name="back_headware_ip" ng-pattern="/^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right"><span class="star-color">* </span>备用上报端口</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.back_port_up" required="" name="back_port_up" ng-pattern="/^[0-9]*$/"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right"><span class="star-color">* </span>主下发端口</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.main_port_down" ng-pattern="/^[0-9]*$/" name="main_port_down" required="" />
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right"><span class="star-color">* </span>备用下发端口</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.back_port_down" required="" name="back_port_down" ng-pattern="/^[0-9]*$/"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right">当前容量</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.current_capacity" ng-pattern="/^[0-9]*$/"  name="current_capacity" />
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-4 control-label text-right">最大容量</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDFS.capacity" ng-pattern="/^[0-9]*$/"  name="capacity" />
										</div>
									</div>
								</div>
								<div class="row" ng-if="'insert'!=modifyType">
									<label class="col-sm-4 control-label text-right"><span class="star-color">* </span>是否启用</label>
									<div class="col-md-8">
										<div class="radio-list">
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedDFS.valid_flag" type="radio"  value="1" 
												ng-selected="selectedDFS.valid_flag==1">
													启用
											</label>
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedDFS.valid_flag" type="radio"  value="0" 
												ng-selected="selectedDFS.valid_flag==0">
													停用
											</label>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" ng-click="validateForm.reset()" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
							<button type="button" class="btn btn-primary" w5c-form-submit="modifyDicForwardSrv();"><i class="fa fa-check"></i>保存</button>
						</div>
						</form>
					</div>
				</div>
			</div>
			
			<div id="allotChargerManage" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false" >
				<div class="modal-dialog" style="width:1000px">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">×</button>
							<h4 class="modal-title">硬件服务器【{{selectedDFS.forward_srv_name}}】分配电桩管理</h4>
						</div>

						<div class="modal-body form">

							<div class="form-group">
								<div class="table_btn_box" >
									<a class="btn blue" href="javascript:;" ng-click="changeCharerList('alloted');">
										显示已分配电桩
									</a>
									<a class="btn blue" href="javascript:;" ng-click="changeCharerList('unAllot');">
										显示可分配电桩
									</a>
									<a class="btn blue" href="javascript:;" ng-click="relevanceCharger();" ng-if="relevanceFlag=='unAllot'">
										绑定
									</a>
									<a class="btn blue" href="javascript:;" ng-click="relevanceCharger();" ng-if="relevanceFlag=='alloted'">
										解绑
									</a>
								</div>
								<table class="table table-striped table-bordered table-hover"
									id="table_2">
									<thead>
										<tr>
											<th class="table-checkbox">
												<input type="checkbox" class="checkbox_table" />
											</th>
											<th>桩ID</th>
											<th>站点名称</th>
											<th>运营二维码</th>
										</tr>
									</thead>
									<tbody>
										<tr class="odd gradeX"
											ng-repeat="charger in chargerList  track by $index"
											on-loaded="{{$last}}" target-table="table_2">
											<td>
												<input type="checkbox" class="checkboxes" value="{{charger.charger_id}}" name="chargerRowModel"/>
											</td>
											<td>
												<span ng-bind="charger.charger_id"></span>
											</td>
											<td>
												<span ng-bind="charger.station_name"></span>
											</td>
											<td>
												<span ng-bind="charger.qr_code"></span>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-danger" data-dismiss="modal">
								<i class="fa fa-times"></i>关闭
							</button>
						</div>
					</div>
				</div>
			</div>

			

			
</body>
</html>
